<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts: lib/queue.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">ESP8266ILI9341DisplayProject</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">queue.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Ring buffer code.  
<a href="#details">More...</a></p>

<p><a href="queue_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structqueue__t.html">queue_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">queue structure  <a href="structqueue__t.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ad0fe97585b8891f5e4f2b9a6426330a4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#ad0fe97585b8891f5e4f2b9a6426330a4">MEMSPACE</a></td></tr>
<tr class="separator:ad0fe97585b8891f5e4f2b9a6426330a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a991bfb3afb6f6913d6b216c7d9a74810"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a991bfb3afb6f6913d6b216c7d9a74810">QUEUE_OVERRUN</a>&#160;&#160;&#160;1</td></tr>
<tr class="separator:a991bfb3afb6f6913d6b216c7d9a74810"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a140a823cbbec938f79f3698c4e433d6c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a140a823cbbec938f79f3698c4e433d6c">QUEUE_EOL</a>&#160;&#160;&#160;2</td></tr>
<tr class="separator:a140a823cbbec938f79f3698c4e433d6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a9bdc538e328e481eb5f5b52ba10d36b9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structqueue__t.html">queue_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a9bdc538e328e481eb5f5b52ba10d36b9">queue_new</a> (<a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a> size)</td></tr>
<tr class="memdesc:a9bdc538e328e481eb5f5b52ba10d36b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a ring buffer of a given size.  <a href="#a9bdc538e328e481eb5f5b52ba10d36b9">More...</a><br /></td></tr>
<tr class="separator:a9bdc538e328e481eb5f5b52ba10d36b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6bac5e705b44fd0b677b9ff9b3a19a23"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a6bac5e705b44fd0b677b9ff9b3a19a23">queue_del</a> (<a class="el" href="structqueue__t.html">queue_t</a> *q)</td></tr>
<tr class="memdesc:a6bac5e705b44fd0b677b9ff9b3a19a23"><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete a ring buffer and free memory.  <a href="#a6bac5e705b44fd0b677b9ff9b3a19a23">More...</a><br /></td></tr>
<tr class="separator:a6bac5e705b44fd0b677b9ff9b3a19a23"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af654fe25b559b820fabf86f0a685e57a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#af654fe25b559b820fabf86f0a685e57a">queue_flush</a> (<a class="el" href="structqueue__t.html">queue_t</a> *q)</td></tr>
<tr class="memdesc:af654fe25b559b820fabf86f0a685e57a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flush ring buffer.  <a href="#af654fe25b559b820fabf86f0a685e57a">More...</a><br /></td></tr>
<tr class="separator:af654fe25b559b820fabf86f0a685e57a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d73971b8454e29803ddc0763a2413c6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a3d73971b8454e29803ddc0763a2413c6">queue_used</a> (<a class="el" href="structqueue__t.html">queue_t</a> *q)</td></tr>
<tr class="memdesc:a3d73971b8454e29803ddc0763a2413c6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find the number of bytes used by the ring buffer.  <a href="#a3d73971b8454e29803ddc0763a2413c6">More...</a><br /></td></tr>
<tr class="separator:a3d73971b8454e29803ddc0763a2413c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c47c1a42dc50ea36aab9629c4378b37"><td class="memItemLeft" align="right" valign="top"><a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a5c47c1a42dc50ea36aab9629c4378b37">queue_empty</a> (<a class="el" href="structqueue__t.html">queue_t</a> *q)</td></tr>
<tr class="memdesc:a5c47c1a42dc50ea36aab9629c4378b37"><td class="mdescLeft">&#160;</td><td class="mdescRight">Is the ring buffer empty ?  <a href="#a5c47c1a42dc50ea36aab9629c4378b37">More...</a><br /></td></tr>
<tr class="separator:a5c47c1a42dc50ea36aab9629c4378b37"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6309ae001025faf270eb01c0f78c2cba"><td class="memItemLeft" align="right" valign="top"><a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a6309ae001025faf270eb01c0f78c2cba">queue_space</a> (<a class="el" href="structqueue__t.html">queue_t</a> *q)</td></tr>
<tr class="memdesc:a6309ae001025faf270eb01c0f78c2cba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find the amount of free space remaining in the ring buffer.  <a href="#a6309ae001025faf270eb01c0f78c2cba">More...</a><br /></td></tr>
<tr class="separator:a6309ae001025faf270eb01c0f78c2cba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ace76ddf1f8e6b6b0d836ff6ac0255311"><td class="memItemLeft" align="right" valign="top"><a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#ace76ddf1f8e6b6b0d836ff6ac0255311">queue_full</a> (<a class="el" href="structqueue__t.html">queue_t</a> *q)</td></tr>
<tr class="memdesc:ace76ddf1f8e6b6b0d836ff6ac0255311"><td class="mdescLeft">&#160;</td><td class="mdescRight">Is the ring buffer full ?  <a href="#ace76ddf1f8e6b6b0d836ff6ac0255311">More...</a><br /></td></tr>
<tr class="separator:ace76ddf1f8e6b6b0d836ff6ac0255311"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a69e47095291acc128fa52906bfe5cebf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a69e47095291acc128fa52906bfe5cebf">queue_push_buffer</a> (<a class="el" href="structqueue__t.html">queue_t</a> *q, <a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *src, <a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a> size)</td></tr>
<tr class="memdesc:a69e47095291acc128fa52906bfe5cebf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a data buffer to the ring buffer Note: This function does not wait/block util there is enough free space to meet the request. So you must check that the return value matches the size.  <a href="#a69e47095291acc128fa52906bfe5cebf">More...</a><br /></td></tr>
<tr class="separator:a69e47095291acc128fa52906bfe5cebf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aff31d44fd9a36c7e59740485c6142f4f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#aff31d44fd9a36c7e59740485c6142f4f">queue_pop_buffer</a> (<a class="el" href="structqueue__t.html">queue_t</a> *q, <a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *<a class="el" href="time_8c.html#a5a388b2bb2a2a9914c7d68ed3d09f7e9">dst</a>, <a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a> size)</td></tr>
<tr class="memdesc:aff31d44fd9a36c7e59740485c6142f4f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a data buffer from the ring buffer. Note: This function does not wait/block until there is enough data to fill the request. So you must check that the return value matches the size.  <a href="#aff31d44fd9a36c7e59740485c6142f4f">More...</a><br /></td></tr>
<tr class="separator:aff31d44fd9a36c7e59740485c6142f4f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a918e9bab1d67104964e167722a4d3793"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a918e9bab1d67104964e167722a4d3793">queue_pushc</a> (<a class="el" href="structqueue__t.html">queue_t</a> *q, <a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> c)</td></tr>
<tr class="memdesc:a918e9bab1d67104964e167722a4d3793"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a byte to the ring buffer Note: This function does not wait/block util there is enough free space to meet the request. We assume you check <a class="el" href="queue_8c.html#ace76ddf1f8e6b6b0d836ff6ac0255311" title="Is the ring buffer full ? ">queue_full()</a> before calling this function! Otherwise you must check that the return value matches 1.  <a href="#a918e9bab1d67104964e167722a4d3793">More...</a><br /></td></tr>
<tr class="separator:a918e9bab1d67104964e167722a4d3793"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc939b887e06d9c92507c37fa6a87cb8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#adc939b887e06d9c92507c37fa6a87cb8">queue_popc</a> (<a class="el" href="structqueue__t.html">queue_t</a> *q)</td></tr>
<tr class="memdesc:adc939b887e06d9c92507c37fa6a87cb8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove a byte from the ring buffer Note: This function does not wait/block util there is data to meet the request. We assume you check <a class="el" href="queue_8c.html#a5c47c1a42dc50ea36aab9629c4378b37" title="Is the ring buffer empty ? ">queue_empty()</a> before calling this function!  <a href="#adc939b887e06d9c92507c37fa6a87cb8">More...</a><br /></td></tr>
<tr class="separator:adc939b887e06d9c92507c37fa6a87cb8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Ring buffer code. </p>
<dl class="section user"><dt>Copyright &copy; 2015 Mike Gore, GPL License</dt><dd></dd></dl>
<dl class="section user"><dt>You are free to use this code under the terms of GPL</dt><dd>Please retain a copy of this notice in any code you use it in.</dd></dl>
<p>This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>
<p>This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>. </p>

<p>Definition in file <a class="el" href="queue_8h_source.html">queue.h</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="ad0fe97585b8891f5e4f2b9a6426330a4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MEMSPACE</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="queue_8h_source.html#l00029">29</a> of file <a class="el" href="queue_8h_source.html">queue.h</a>.</p>

</div>
</div>
<a class="anchor" id="a140a823cbbec938f79f3698c4e433d6c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define QUEUE_EOL&#160;&#160;&#160;2</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="queue_8h_source.html#l00033">33</a> of file <a class="el" href="queue_8h_source.html">queue.h</a>.</p>

<p>Referenced by <a class="el" href="uart_8c_source.html#l00572">kbhiteol()</a>, <a class="el" href="queue_8c_source.html#l00244">queue_popc()</a>, and <a class="el" href="queue_8c_source.html#l00216">queue_pushc()</a>.</p>

</div>
</div>
<a class="anchor" id="a991bfb3afb6f6913d6b216c7d9a74810"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define QUEUE_OVERRUN&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="queue_8h_source.html#l00032">32</a> of file <a class="el" href="queue_8h_source.html">queue.h</a>.</p>

<p>Referenced by <a class="el" href="queue_8c_source.html#l00216">queue_pushc()</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a6bac5e705b44fd0b677b9ff9b3a19a23"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void queue_del </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structqueue__t.html">queue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Delete a ring buffer and free memory. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">*q</td><td>ring buffer pointer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

<p>Definition at line <a class="el" href="queue_8c_source.html#l00062">62</a> of file <a class="el" href="queue_8c_source.html">queue.c</a>.</p>

</div>
</div>
<a class="anchor" id="a5c47c1a42dc50ea36aab9629c4378b37"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a> queue_empty </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structqueue__t.html">queue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Is the ring buffer empty ? </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">*q</td><td>ring buffer pointer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if empty, 0 otherwise </dd></dl>

<p>Definition at line <a class="el" href="queue_8c_source.html#l00114">114</a> of file <a class="el" href="queue_8c_source.html">queue.c</a>.</p>

<p>Referenced by <a class="el" href="uart_8c_source.html#l00585">kbhit()</a>, <a class="el" href="uart_8c_source.html#l00572">kbhiteol()</a>, and <a class="el" href="uart_8c_source.html#l00406">uart_flush()</a>.</p>

</div>
</div>
<a class="anchor" id="af654fe25b559b820fabf86f0a685e57a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void queue_flush </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structqueue__t.html">queue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Flush ring buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">*q</td><td>ring buffer pointer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

<p>Definition at line <a class="el" href="queue_8c_source.html#l00087">87</a> of file <a class="el" href="queue_8c_source.html">queue.c</a>.</p>

</div>
</div>
<a class="anchor" id="ace76ddf1f8e6b6b0d836ff6ac0255311"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a> queue_full </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structqueue__t.html">queue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Is the ring buffer full ? </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">*q</td><td>ring buffer pointer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if full, 0 otherwise </dd></dl>

<p>Definition at line <a class="el" href="queue_8c_source.html#l00140">140</a> of file <a class="el" href="queue_8c_source.html">queue.c</a>.</p>

<p>Referenced by <a class="el" href="uart_8c_source.html#l00406">uart_flush()</a>.</p>

</div>
</div>
<a class="anchor" id="a9bdc538e328e481eb5f5b52ba10d36b9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structqueue__t.html">queue_t</a>* queue_new </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a>&#160;</td>
          <td class="paramname"><em>size</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a ring buffer of a given size. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>size of rin buffer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>popinter to ring buffer structure </dd></dl>

<p>Definition at line <a class="el" href="queue_8c_source.html#l00038">38</a> of file <a class="el" href="queue_8c_source.html">queue.c</a>.</p>

</div>
</div>
<a class="anchor" id="aff31d44fd9a36c7e59740485c6142f4f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a> queue_pop_buffer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structqueue__t.html">queue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a>&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get a data buffer from the ring buffer. Note: This function does not wait/block until there is enough data to fill the request. So you must check that the return value matches the size. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">*q</td><td>ring buffer pointer </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">*dst</td><td>outout buffer </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>size of input buffer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of bytes actually added to the buffer - may not be size! </dd></dl>

<p>Definition at line <a class="el" href="queue_8c_source.html#l00186">186</a> of file <a class="el" href="queue_8c_source.html">queue.c</a>.</p>

</div>
</div>
<a class="anchor" id="adc939b887e06d9c92507c37fa6a87cb8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int queue_popc </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structqueue__t.html">queue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Remove a byte from the ring buffer Note: This function does not wait/block util there is data to meet the request. We assume you check <a class="el" href="queue_8c.html#a5c47c1a42dc50ea36aab9629c4378b37" title="Is the ring buffer empty ? ">queue_empty()</a> before calling this function! </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">*q</td><td>ring buffer pointer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>byte , or 0 if ring buffer was empty (user error) </dd></dl>

<p>Definition at line <a class="el" href="queue_8c_source.html#l00244">244</a> of file <a class="el" href="queue_8c_source.html">queue.c</a>.</p>

<p>Referenced by <a class="el" href="uart_8c_source.html#l00406">uart_flush()</a>.</p>

</div>
</div>
<a class="anchor" id="a69e47095291acc128fa52906bfe5cebf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a> queue_push_buffer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structqueue__t.html">queue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a>&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add a data buffer to the ring buffer Note: This function does not wait/block util there is enough free space to meet the request. So you must check that the return value matches the size. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">*q</td><td>ring buffer pointer </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">*src</td><td>input buffer </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>size of input buffer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of bytes actually added to the buffer - may not be size! </dd></dl>

<p>Definition at line <a class="el" href="queue_8c_source.html#l00157">157</a> of file <a class="el" href="queue_8c_source.html">queue.c</a>.</p>

</div>
</div>
<a class="anchor" id="a918e9bab1d67104964e167722a4d3793"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int queue_pushc </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structqueue__t.html">queue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>c</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add a byte to the ring buffer Note: This function does not wait/block util there is enough free space to meet the request. We assume you check <a class="el" href="queue_8c.html#ace76ddf1f8e6b6b0d836ff6ac0255311" title="Is the ring buffer full ? ">queue_full()</a> before calling this function! Otherwise you must check that the return value matches 1. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">*q</td><td>ring buffer pointer </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">c</td><td>vyte to add </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of bytes actually added to the buffer - may not be 1! </dd></dl>

<p>Definition at line <a class="el" href="queue_8c_source.html#l00216">216</a> of file <a class="el" href="queue_8c_source.html">queue.c</a>.</p>

<p>Referenced by <a class="el" href="uart_8c_source.html#l00406">uart_flush()</a>.</p>

</div>
</div>
<a class="anchor" id="a6309ae001025faf270eb01c0f78c2cba"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a> queue_space </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structqueue__t.html">queue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Find the amount of free space remaining in the ring buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">*q</td><td>ring buffer pointer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>bytes remining in ring buffer </dd></dl>

<p>Definition at line <a class="el" href="queue_8c_source.html#l00128">128</a> of file <a class="el" href="queue_8c_source.html">queue.c</a>.</p>

<p>Referenced by <a class="el" href="queue_8c_source.html#l00140">queue_full()</a>, and <a class="el" href="queue_8c_source.html#l00157">queue_push_buffer()</a>.</p>

</div>
</div>
<a class="anchor" id="a3d73971b8454e29803ddc0763a2413c6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="cpu_8h.html#aea0c7eab1ce1eebb4e879ef4e23c16ee">size_t</a> queue_used </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structqueue__t.html">queue_t</a> *&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Find the number of bytes used by the ring buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">*q</td><td>ring buffer pointer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the number of bytes used in the ring buffer </dd></dl>

<p>Definition at line <a class="el" href="queue_8c_source.html#l00102">102</a> of file <a class="el" href="queue_8c_source.html">queue.c</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 31 2018 21:22:16 for ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
